package com.hand.lwf24378.materials.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author : WaveLee
 * @date : 2019/7/19 14:50
 * @description : 物料信息实体类
 */
@ApiModel(description = "物料信息")
public class Materials extends BaseEntity{
    /**
     * 主键id
     */
    @ApiModelProperty("主键，自增")
    private Long itemId;
    /**
     * 物料编码
     */
    @ApiModelProperty("物料编码，后端生成，")
    @Excel(name = "物料编码",width = 20)
    private String itemCode;
    /**
     * 物料描述
     */
    @NotNull
    @ApiModelProperty("物料描述")
    @Excel(name = "物料描述",width = 20)
    private String itemDescription;
    /**
     * 物料单位  米、平方米、立方米、千克、个、其他
     */
    @NotNull
    @ApiModelProperty("物料单位  米、平方米、立方米、千克、个、其他")
    @Excel(name = "物料单位")
    private String itemUom;
    /**
     * 生效起始时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("生效起始时间")
    @Excel(name = "生效起始时间",width = 20,exportFormat = "yyyy-MM-dd")
    private Date startActiveDate;
    /**
     * 生效结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("生效结束时间")
    @Excel(name = "生效结束时间",width = 20,exportFormat = "yyyy-MM-dd")
    private Date endActiveDate;
    /**
     * 启用标志
     */
    @ApiModelProperty("启用标志，1启用/2不启用，（为方便查询，这里使用整型）")
    @NotNull
    @Excel(name = "是否启用",replace = {"是_1","否_0"})
    private Integer enabledFlag;

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public String getItemDescription() {
        return itemDescription;
    }

    public void setItemDescription(String itemDescription) {
        this.itemDescription = itemDescription;
    }

    public String getItemUom() {
        return itemUom;
    }

    public void setItemUom(String itemUom) {
        this.itemUom = itemUom;
    }

    public Date getStartActiveDate() {
        return startActiveDate;
    }

    public void setStartActiveDate(Date startActiveDate) {
        this.startActiveDate = startActiveDate;
    }

    public Date getEndActiveDate() {
        return endActiveDate;
    }

    public void setEndActiveDate(Date endActiveDate) {
        this.endActiveDate = endActiveDate;
    }

    public Integer getEnabledFlag() {
        return enabledFlag;
    }

    public void setEnabledFlag(Integer enabledFlag) {
        this.enabledFlag = enabledFlag;
    }

    @Override
    public String toString() {
        return "Materials{" +
                "itemId=" + itemId +
                ", itemCode='" + itemCode + '\'' +
                ", itemDescription='" + itemDescription + '\'' +
                ", itemUom='" + itemUom + '\'' +
                ", startActiveDate=" + startActiveDate +
                ", endActiveDate=" + endActiveDate +
                ", enabledFlag=" + enabledFlag +
                '}';
    }
}
